package leetcode;

/**
 * description:
 * author:zt
 * date:2022-05-12
 */
public class leetcode944 {
    public int minDeletionSize(String[] strs) {
        if (strs == null || strs.length == 0) return 0;
        int res = 0;
        for (int i = 0; i < strs[0].length(); i++) {
            int index = 0;
            for (int j = 0; j < strs.length - 1; j++) {
                if (strs[j].charAt(i) <= strs[j+1].charAt(i)) index++;
                else break;
            }
            if (index != strs.length - 1) res++;
        }
        return res;
    }
}
